﻿package com.crl.module.media.player {
	import flash.events.Event;
	import flash.events.EventDispatcher;
	import flash.events.IOErrorEvent;
	import flash.events.ProgressEvent;

	public class AbstractPlayer extends EventDispatcher{
		protected var _playing:Boolean=false;
		
		protected var _currentPath:String;
		protected var _position:Number;
		
		public function AbstractPlayer (){
			this.init();
		}
		
		protected function init():void{
			
		}
		
		protected function loadProgressHandler(event:ProgressEvent):void{
			trace(event.bytesLoaded,event.bytesTotal);
			this.dispatchEvent(event);
		}
		
		protected function completeHander(event:Event):void{
			this.dispatchEvent(event);
		}
		protected function ioErrorHandler(event:IOErrorEvent):void{
			this.dispatchEvent(event);
		}
		
		public function get url():String{
			return this._currentPath;
		}
		
		public function get isPlaying():Boolean
		{
			return _playing;
		}
		
	}
}
